-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream-Rail distribution with addr + port #1411
Conversation
@tom95858 Shall I also include the stream name into the calculation to increase the distribution? |
I'll add |
@narategithub what's the status of this? |
When the stream forward the stream data, it used the peer address to determine the endpoint in the rail to forward the data. This patch adds `port` into the calculation as well to increase the stream data distribution among the endpoints in the rail.
@tom95858 the code is done but the |
53aa7a5
to
f147f17
Compare
@tom This is ready for your review. |
@@ -478,6 +491,7 @@ __stream_deliver(struct ldms_addr *src, uint64_t msg_gn, | |||
.name_len = name_len, | |||
.data_len = data_len, | |||
.name = stream_name, | |||
.name_hash = hash, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going to put the hash in the message, you could put the entire thing in there and avoid the computation on every message. The port and addr aren't changing. This would also mean that the same hash is used all the way up the chain from sender to consumer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The address got changed in the following case.
There is a logic to exclude the use of local
address (e.g. 127.0.0.1
) as src
address here:
This is to prevent the case that the application running on the same host connects to sampler ldmsd using localhost
address and make all src
in the messages from all nodes being 127.0.0.1
. Basically, if the src
address is local, do not resolve it and let the next guy resolve it instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So there must be code somewhere else that checks the address and family and if 0 sets it to the address and port of the forwarder? Where is that logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@narategithub In any event, all we're doing here is randomizing the seed to what we hope will be a random hash. So as-usual, we've found ourselves in a hole so we keep digging. Let's just back up and decide how we're going to generate a random hash.
Adding the (hash of) stream name into the endpoint index calculation to increase entropy (and hopefully more even distribution among endpoints).
f147f17
to
45251ba
Compare
Closing this PR. This will be a part of adaptive flow control PR. |
When the stream forward the stream data, it used the peer address to determine the endpoint in the rail to forward the data. This patch adds
port
into the calculation as well to increase the stream data distribution among the endpoints in the rail.